package goodenglish.domain.model.lexicon;

import goodenglish.infrastructure.DateUtil;
import goodenglish.interfaces.UUID;

import java.util.ArrayList;
import java.util.List;

public class StudyPlanFactory {
	public StudyPlan createStudyPlan(Lexicon lexicon) {
		StudyPlan studyPlan = new StudyPlan();
		studyPlan.setId(UUID.getUUID());
		studyPlan.setName("新计划" + DateUtil.getCurrTimeMiniteStr());
		List<StudyInfo> studyInfos=new ArrayList<StudyInfo>();
		for(NewWord newWord:lexicon.getNotPlanedNewWords(3)){
			StudyInfo studyInfo=new StudyInfo();
			studyInfo.setId(newWord.getId());
			studyInfo.setNewWord(newWord);
			studyInfos.add(studyInfo);
		}
		studyPlan.setStudyInfos(studyInfos);
		return studyPlan;
	}
}
